package org.example.controller;

import org.example.common.lang.Result;
import org.example.mapper.UserMapper;
import org.example.model.User;
import org.example.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user")
public class LoginController {
    @Autowired
    UserService userService;

//    @PostMapping("/login")
//    public Result login(User user){
//        return Result.success(userService.login(user));
//    }
    @PostMapping("/register")
    public Result register(User user){
        return Result.success(userService.register(user));
    }

}
